import Vue from "vue";
import ElementUI from "element-ui";
import locale from "element-ui/lib/locale/lang/zh-CN";
import App from "./App";
import store from "./store";
import router from "./router";
// 引入样式
import "normalize.css/normalize.css";
import "element-ui/lib/theme-chalk/index.css";
import "@/styles/reset.scss";
import "@/styles/common.scss";
import "@/styles/element.scss";

import "@/assets/icons"; // icon
import "@/permission"; // permission control
import md5 from "js-md5";
import SlideVerify from "vue-monoplasty-slide-verify";
import VueClipboard from "vue-clipboard2";
import echarts from 'echarts'
Vue.use(VueClipboard);

Vue.use(SlideVerify);
// set ElementUI lang to EN
Vue.use(ElementUI, { locale });

const globalObj = require("./settings.js");
Vue.prototype.$echarts = echarts

Vue.config.productionTip = false;

//屏蔽错误
Vue.config.errorHandler = () => null;
//屏蔽警告
Vue.config.warnHandler = () => null;

Vue.prototype.$globalObj = globalObj;
Vue.prototype.$md5 = md5;
Vue.prototype.$hasMethod = (val) => {
  return vue.$route.meta.methods && vue.$route.meta.methods.indexOf(val) > -1;
};

const vue = new Vue({
  el: "#app",
  router,
  store,
  render: (h) => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this;
  }
});
